fix: nuxt vue vite plugin registration fail (fix #590) #643
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR aims to resolve issue #590. This issue appears to be related to mismatching of versions of vite and potentially related to vue plugin versions too.
The code block that has been removed here sought to patch in the expected Vite Vue plugins with a view to allowing customisation of the vue plugins by Histoire. However there doesn't seem to be any custom configurations applied and as this is causing issues on current versions of Nuxt and going back to previous versions it seems to be present I believe this is worthy of resolving here.
Changing the hook being used here to configResolved means we get the full nuxt config including these two plugins that are included by nuxt in between the two hooks used here. See the following code block https:/nuxt/nuxt/blob/38b6d88cfab3477edabfa37d6f97b95eefc6ae6c/packages/vite/src/client.ts#L142-L149
The issue appears to be that global components are transformed twice. I was unable to find where in the nuxt config this may have been coming from so we could replicate in histoire but surely it would be better to just leave the nuxt vite config as is until there is a requirement to customise the settings on these two plugins?
Additional context
Here is a simple repro of the issue with Nuxt nightly. https://stackblitz.com/edit/github-gmhnpy?file=package.json
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).